import { Service } from "../lib";

const KEJIHost = location.protocol === "https:" ? "https://kpjsapi.uzhutm.cn" : "http://kpjs-api.kxcbzx.com:9000";

export const ServiceConfig = Service.createService({
    "env": APP_ENV,
    "host": {
        "DEV": "http://localhost:9000",
        "SIT": "http://47.114.42.241:8083",
        "PROD": KEJIHost,
        "PREPROD": "/api/v1"
    },
    "config": {
        "login": {
            withCredentials: true,
            "endPoints": {
                "status": {
                    url: "/login/admin/status",
                    method: "GET"
                },
                "logout": {
                    url: "/login/logout",
                    method: "POST"
                },
                "captchaGenerate": {
                    url: "/login/captcha/generate",
                    method: "GET",
                    responseType: "blob"
                },
                "submit": {
                    url: "/login/submit",
                    method: "POST"
                },
                "loginByPhoneNumber": {
                    url: "/login/mobile/login/submit",
                    method: "POST"
                },
                "sendSMS": {
                    url: "/login/send/sms/{{phoneNumber}}",
                    method: "POST"
                },
                "config": {
                    url: "/login/config",
                    method: "GET"
                },
                "registe": {
                    url: "/login/registe",
                    method: "POST"
                },
                "webAuth": {
                    url: "/auth/status",
                    method: "GET"
                }
            }
        },
        "setting": {
            withCredentials: true,
            "endPoints": {
                "updateWebsite": {
                    url: "/admin/setting/update/website",
                    method: "POST"
                },
                "configWebsite": {
                    url: "/admin/setting/config/website",
                    method: "GET"
                },
                "configList": {
                    url: "/admin/setting/config/list",
                    method: "GET"
                },
                "configDelete": {
                    url: "/admin/setting/config/delete",
                    method: "DELETE"
                },
                "langaugeList": {
                    url: "/admin/language/list",
                    method: "POST"
                },
                "languageSubmit": {
                    url: "/admin/language/submit",
                    method: "POST"
                },
                "languageDelete": {
                    url: "/admin/language/delete",
                    method: "DELETE"
                },
                "uploadFile": {
                    url: "/admin/upload/file",
                    method: "POST",
                    header: {
                        'Content-Type': 'multipart/form-data'
                    }
                },
                "categorySubmit": {
                    url: "/admin/setting/option/submit",
                    method: "POST"
                },
                "regionList": {
                    url: "/admin/setting/region/list",
                    method: "GET"
                },
                "jsCityList": {
                    url: "/config/region/jscities",
                    method: "GET"
                }
            }
        },
        "menus": {
            withCredentials: true,
            endPoints: {
                "submit": {
                    url: "/menus/submit",
                    method: "POST"
                },
                "structList": {
                    url: "/menus/struct/list",
                    method: "POST"
                },
                "fullList": {
                    url: "/menus/struct/fullList",
                    method: "POST"
                },
                "list": {
                    url: "/menus/list",
                    method: "POST"
                },
                "delete": {
                    url: "/menus/delete",
                    method: "DELETE"
                },
                "listLimit": {
                    url: "/menus/limit/list",
                    method: "POST"
                }
            }
        },
        "user": {
            withCredentials: true,
            endPoints: {
                "list": {
                    url: "/admin/user/list",
                    method: "POST"
                },
                "update": {
                    url: "/admin/user/edit",
                    method: "POST"
                },
                "create": {
                    url: "/admin/user/create",
                    method: "POST"
                },
                "delete": {
                    url: "/user/delete",
                    method: "POST"
                },
                "status": {
                    url: "/admin/user/update/status",
                    method: "POST"
                },
                "groupList": {
                    url: "/admin/adgroup/list",
                    method: "GET"
                },
                "groupSubmit": {
                    url: "/admin/adgroup/submit",
                    method: "POST"
                },
                "moduleList": {
                    url: "/admin/adgroup/module/list",
                    method: "POST"
                },
                "groupAdd": {
                    url: "/auth/group/add",
                    method: "POST"
                },
                "groupUpdate": {
                    url: "/auth/group/edit",
                    method: "POST"
                },
                "groupDelete": {
                    url: "/auth/group/delete",
                    method: "POST"
                },
                "sendSmsNotify": {
                    url: "/admin/sms/notify/group/user",
                    method: "POST"
                },
                "sendSmsNotifyByUserId": {
                    url: "/admin/sms/notify/user",
                    method: "POST"
                },
                "pageRight": {
                    url: "/admin/user/page/right",
                    method: "GET"
                },
                "authPublisher": {
                    url: "/admin/user/auth/publisher",
                    method: "GET"
                },
                "authApprover": {
                    url: "/admin/user/auth/approver",
                    method: "GET"
                },
                "authEditable": {
                    url: "/admin/user/auth/editable",
                    method: "GET"
                },
                "registeList": {
                    url: "/admin/user/registe/list",
                    method: "POST"
                },
                "registeApprove": {
                    url: "/admin/user/registe/approve",
                    method: "POST"
                },
                "updatePassword": {
                    url: "/admin/user/update/password",
                    method: "POST"
                },
                "deleteRetryLimit": {
                    url: "/login/retry/limit/release",
                    method: "POST"
                }
            }
        },
        "article": {
            withCredentials: true,
            endPoints: {
                "list": {
                    url: "/admin/article/list",
                    method: "POST"
                },
                "importList": {
                    url: "/admin/article/import/list",
                    method: "POST"
                },
                "config": {
                    url: "/admin/article/config",
                    method: "GET"
                },
                "submit": {
                    url: "/admin/article/submit",
                    method: "POST"
                },
                "approveList": {
                    url: "/admin/article/approve/list",
                    method: "POST"
                },
                "approveSubmit": {
                    url: "/admin/article/approve/submit",
                    method: "POST"
                }
            }
        },
        "resource": {
            withCredentials: true,
            endPoints: {
                "list": {
                    url: "/admin/resource/list",
                    method: "POST"
                },
                
                "submit": {
                    url: "/admin/resource/submit",
                    method: "POST"
                },
                "delete": {
                    url: "/admin/resource/delete",
                    method: "DELETE"
               },
               "specialListSubmit": {
                    url: "/admin/speciallist/submit",
                    method: "POST"
               },
               "speciallList": {
                    url: "/admin/speciallist/list",
                    method: "POST"
               },
               "importList": {
                    url: "/admin/speciallist/import/list",
                    method: "POST"
                },
               "upload": {
                    url: "/admin/upload/file",
                    method: "POST"
               },
               "uploadMerge": {
                    url: "/admin/upload/merge",
                    method: "POST"
               },
               "lawDocSubmit": {
                    url: "/admin/resource/lawdoc/submit",
                    method: "POST"
                },
                "lawDocList": {
                    url: "/admin/resource/lawdoc/list",
                    method: "POST"
                },
                "mediaUrl": {
                    url: "/resource/media",
                    method: "GET"
                },
                "schoolList": {
                    url: "/admin/school/list",
                    method: "POST"
                },
                "editSchool": {
                    url: "/admin/school/submit",
                    method: "POST"
                },
                "expertApproveList": {
                    url: "/admin/speciallist/approve/list",
                    method: "POST"
                },
                "expertApproveSubmit": {
                    url: "/admin/speciallist/approve/submit",
                    method: "POST"
                }
            }
        },
        "activity": {
            "withCredentials": true,
            "endPoints": {
                "submit": {
                    "url": "/admin/activity/submit",
                    "method": "POST"
                },
                "list": {
                    url: "/admin/activity/list",
                    "method": "POST"
                },
                
                "updateStatus": {
                    url: "/admin/activity/update/status",
                    method: "POST"
                },
                "updateResponse": {
                    url: "/admin/activity/update/response",
                    method: "POST"
                },
                "approveList": {
                    url: "/admin/activity/approve/list",
                    "method": "POST"
                },
                "approveSubmit": {
                    url: "/admin/activity/approve/submit",
                    method: "POST"
                },
                "applySubmit": {
                    url: "/admin/activity/apply/submit",
                    method: "POST"
                },
                "applyList": {
                    url: "/admin/activity/apply/list",
                    "method": "POST"
                },
                "applyWithdraw": {
                    url: "/admin/activity/apply/withdraw",
                    method: "POST"
                },
                "applyDelete": {
                    url: "/admin/activity/apply/delete",
                    method: "DELETE"
                },
                "approveApplyList": {
                    url: "/admin/activity/apply/approve/list",
                    method: "POST"
                },
                "applyDealwithUsers": {
                    url: "/admin/activity/apply/dealwith/users",
                    method: "GET"
                },
                "applyAuthUser": {
                    url: "/admin/activity/apply/auth/user",
                    method: "POST"
                },
                "applyStatus": {
                    url: "/admin/activity/apply/status",
                    method: "POST"
                },
                "applyUpdate": {
                    url: "/admin/activity/apply/update",
                    method: "POST"
                },
                "applyDetails": {
                    url:  "/admin/activity/apply/details/{id}",
                    method: "GET"
                }
            }
        },
        "lawdoc": {
            "withCredentials": true,
            "endPoints": {
                "approveList": {
                    url: "/admin/lawdoc/approve/list",
                    "method": "POST"
                },
                "approveSubmit": {
                    url: "/admin/lawdoc/approve/submit",
                    "method": "POST"
                }
            }
        },
        "carousel": {
            "withCredentials": true,
            "endPoints": {
                "submit": {
                    "url": "/admin/carousel/submit",
                    "method": "POST"
                },
                "list": {
                    url: "/admin/carousel/list",
                    "method": "POST"
                },
                "category": {
                    url: "/admin/carousel/category",
                    "method": "GET"
                },
                "delete": {
                    url: "/admin/carousel/delete",
                    method: "DELETE"
                }
            }
        },
        "web": {
            "withCredentials": true,
            "endPoints": {
                "dashboard": {
                    url: "/home/dashboard",
                    method: "GET"
                },
                "articleDetails": {
                    url: "/resource/article/{id}",
                    method: "GET",
                    header: {
                        "X-Device": "Admin"
                    }
                },
                "activityDetails": {
                    url: "/resource/activity/{id}",
                    method: "GET",
                    header: {
                        "X-Device": "Admin"
                    }
                },
                "lawdocDetails": {
                    url: "/resource/lawdoc/{id}",
                    method: "GET",
                    header: {
                        "X-Device": "Admin"
                    }
                },
                "expertDetails": {
                    url: "/resource/expert/{id}",
                    method: "GET",
                    header: {
                        "X-Device": "Admin"
                    }
                }
            }
        },
        "files": {
            "withCredentials": true,
            "endPoints": {
                "list": {
                    url: "/admin/files/list",
                    method: "POST"
                },
                "folders": {
                    url: "/admin/files/folders",
                    method: "GET"
                },
                "delete": {
                    url: "/admin/files/delete",
                    method: "DELETE"
                },
                "fileStatus": {
                    url: "/admin/files/fileStatus",
                    method: "GET"
                },
                "diskInfo": {
                    url: "/admin/files/disk/size",
                    method: "GET"
                },
                "getFileInfo": {
                    url: "/admin/files/{id}",
                    method: "GET"
                }
            }
        },
        "venue": {
            "withCredentials": true,
            "endPoints": {
                "list": {
                    url: "/admin/venue/v1/science/venue/list",
                    method: "POST"
                },
                "submit": {
                    url: "/admin/venue/v1/science/venue/submit",
                    method: "POST"
                },
                "delete": {
                    url: "/admin/venue/delete",
                    method: "DELETE"
                },
                "updateStatus": {
                    url: "/admin/venue/v1/sciencce/venue/status",
                    method: "POST"
                },
                "approverRight": {
                    url: "/admin/venue/v1/science/venue/approver",
                    method: "GET"
                },
                "venueRouteList": {
                    url: "/admin/venue/v1/science/venue/route/list",
                    method: "POST"
                },
                "venueRouteSubmit": {
                    url: "/admin/venue/v1/science/venue/route/submit",
                    method: "POST"
                },
                "venueRouteUpdateStatus": {
                    url: "/admin/venue/v1/science/venue/status/update",
                    method: "PUT"
                },
                "venueAccountAsync": {
                    url: "/admin/venue/v1/science/venue/owner/async",
                    method: "GET"
                },
                "venueFirstApprover": {
                    url: "/authentication/venue/city/approve",
                    method: "GET"
                },
                "venueSecondApprover": {
                    url: "/authentication/venue/toplevel/approve",
                    method: "GET"
                }
            }
        }
    }
});
